1. Field of the Invention
The present general inventive concept generally relates to an image processing device and a method thereof. More specifically, the present general inventive concept relates to an image processing device capable of resizing an input image without incurring image deterioration at edges, and a method thereof.
2. Description of the Related Art
An image signal input to a display carries a limited amount of information. When an image, which is the collection of such image signals, is resized according to a size of the display or according to a user's desired size, the image on the display may be distorted. For example, if the input image is enlarged twice, each source data is mapped into a destination data of the enlarged image as shown in FIG. 1. Specifically, the source data A of coordinates (0, 0) is mapped to the destination data of coordinates (0, 0), the source data B of coordinates (0, 1) is mapped to the destination data of coordinates (0, 2), the source data C of coordinates (1, 0) is mapped to the destination data of coordinates (2, 0), and the source data D of coordinates (1, 1) is mapped to the destination data of coordinates (2, 2). The source data A, B, C and D represent pixel values, respectively. The destination data of coordinates (0, 1), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 1), (2, 3), (3, 0), (3, 1), (3, 2) and (3, 3) remain empty without being mapped to the source data, which causes distortion of the image signal.
Interpolation technology is required to address the above drawbacks. The interpolation re-samples the image data to determine values between defined pixels. That is, the interpolation creates values between the pixels when enlarging the image signal. Frequently used interpolation algorithms include a nearest neighbor pixel interpolation, a bilinear interpolation, and a cubic convolution interpolation.
The nearest neighbor pixel interpolation outputs values between pixels by selecting values of the nearest neighbor pixels as shown in FIG. 2. This interpolation does not deteriorate the original image data, but may introduce errors of 1/√{square root over (2)} in maximum and coarse image since output pixels are obtained from the collection of input pixels without generating new data.
The bilinear interpolation outputs values between pixels by selecting a weighted average with respect to distances to four adjacent pixels as shown in FIG. 3. The bilinear interpolation rearranges the pixel values of the interpolated image based on the following equation.
[Equation 1]R=(1−u)(2−v)Px,y+u(1−v)Px+1,y+(1−u) vPx,y+1+uvPX+1,y+1 
In Equation 1, P indicates a pixel value of the input image signal, and R indicates a pixel value of the interpolated image signal.
The cubic convolution interpolation outputs an interpolated pixel value from the nearest 16 pixel values of the original image surrounding a point to be rearranged, as illustrated in FIG. 4. In a case that a sample data of the original image is ƒ(xk), a continuous function {circumflex over (ƒ)}(x) interpolated from the sample data is expressed as the following equation.
                                          f            ^                    ⁡                      (            x            )                          =                              ∑            k                                                          ⁢                                          ⁢                                    c              k                        ⁢                          β              ⁡                              (                                  x                  -                                      x                    k                                                  )                                                                        [                  Equation          ⁢                                          ⁢          2                ]            
In Equation 2, β(x) is a basis function, ck is a coefficient relating to the pixel value ƒ(xk), x indicates an interpolation point, and xk and xk+1 indicate pixel locations at a current resolution. The continuous function expressed as Equation 2 may be rearranged to a sin c(x) function for the sake of a more ideal interpolation as the following equation:
                                          f            ^                    ⁡                      (            x            )                          =                              ∑            k                                                          ⁢                                          ⁢                                    f              ⁡                              (                                  x                  k                                )                                      ⁢            sin            ⁢                                                  ⁢                                          c                ⁡                                  (                                      x                    -                                          x                      k                                                        )                                            .                                                          [                  Equation          ⁢                                          ⁢          3                ]            
However, it is infeasible to implement substantially because the sin c(x) function is defined in an infinite extent. Thus, the cubic convolution interpolated continuous function is suggested instead of the sin c(x) function.
Relation between an interpolation point x to be interpolated and neighboring sampling points is s=x−xk, and 1−s=xk+1−x, where 0≦s≦1 and xk≦x≦xk+1.
If β(x) of Equation 2 is used instead of sin c(x) in Equation 3, finite extent is introduced. That is, a basis kernel function has a valid value in the (−2, 2) region.
                              β          ⁡                      (            x            )                          =                  {                                                                                                                (                                              α                        +                        2                                            )                                        ⁢                                                                                          x                                                                    3                                                        -                                                            (                                              α                        +                        3                                            )                                        ⁢                                                                                          x                                                                    2                                                        +                  1                                                                              0                  ≤                                                          x                                                        ≤                  1                                                                                                                          α                    ⁢                                                                                          x                                                                    3                                                        -                                      5                    ⁢                    α                    ⁢                                                                                          x                                                                    2                                                        +                                      8                    ⁢                    α                    ⁢                                                                x                                                                              -                                      4                    ⁢                    α                                                                                                1                  ≤                                                          x                                                        ≤                  2                                                                                        [                  Equation          ⁢                                          ⁢          4                ]            
If β(x) of Equation 2 substitutes sin c(x) of Equation 3 using the relation between the interpolation point and the sampling points, the cubic convolution interpolated continuous function is expressed as the following equation:
                                                                                          f                  ^                                ⁡                                  (                  x                  )                                            =                            ⁢                                                                    f                    ⁡                                          (                                              x                                                  k                          -                          1                                                                    )                                                        ⁢                                      {                                          α                      ⁡                                              (                                                                              s                            3                                                    -                                                      2                            ⁢                                                          s                              2                                                                                +                          s                                                )                                                              }                                                  +                                                                                                      ⁢                                                                    f                    ⁡                                          (                                              x                        k                                            )                                                        ⁢                                      {                                                                  α                        ⁡                                                  (                                                                                    s                              3                                                        -                                                          s                              2                                                                                )                                                                    +                                              (                                                                              2                            ⁢                                                          s                              3                                                                                -                                                      3                            ⁢                                                          s                              2                                                                                +                          1                                                )                                                              }                                                  +                                                                                                      ⁢                                                f                  ⁡                                      (                                          x                                              k                        +                        1                                                              )                                                  ⁢                                  {                                                            α                      ⁡                                              (                                                                              -                                                          s                              3                                                                                +                                                      2                            ⁢                                                          s                              2                                                                                -                          s                                                )                                                              +                                          (                                                                                                    -                            2                                                    ⁢                                                      s                            3                                                                          +                                                  3                          ⁢                                                      s                            2                                                                                              }                                        +                                                                                                                                        ⁢                                                f                  ⁡                                      (                                          x                                              k                        +                        2                                                              )                                                  ⁢                                                      {                                          α                      ⁡                                              (                                                                              -                                                          s                              3                                                                                +                                                      s                            2                                                                          )                                                              }                                    .                                                                                        [                  Equation          ⁢                                          ⁢          5                ]            
In equation 5, α is a cubic convolution interpolation coefficient.
The cubic convolution interpolation produces a smoother image than the nearest neighbor pixel interpolation and a sharper image than the bilinear interpolation. However, the cubic convolution interpolation may bring about image overshoot or undershoot. The generated overshoot or undershoot deteriorates the image quality.